//
//  CellOfTools.m
//  ProjectA_ManualGuest
//
//  Created by dingcong on 16/6/28.
//  Copyright © 2016年 丁聪. All rights reserved.
//

#import "CellOfTools.h"
#import "Masonry.h"
#import "PrefixHeader.pch"
@interface CellOfTools ()

@property(nonatomic, retain)UILabel *lableOfName;

@property(nonatomic, retain)UILabel *lableOfNum;



@end

@implementation CellOfTools

- (void)dealloc{
    [_model release];
    [_lableOfName release];
    [_lableOfNum release];
    
    [super dealloc];
}


- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    
    if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier])
    {
        [self creat];
    }
    
    return self;
}

- (void)creat{
    
    
    self.contentView.backgroundColor = [UIColor colorWithRed:248.0 / 256.0f green:239.0 / 256.0f blue:239.0 / 256.0f alpha:1];
    self.lableOfName = [[UILabel alloc]init];
    self.lableOfName.backgroundColor = [UIColor whiteColor];
    [self.contentView addSubview:self.lableOfName];
    [self.lableOfName mas_makeConstraints:^(MASConstraintMaker *make) {
        make.leading.equalTo(self.contentView.mas_leading).offset(0);
        make.top.equalTo(self.contentView.mas_top).offset(0);
        make.height.equalTo(self.contentView).multipliedBy(1.0 / 1.0).offset(- 1);
        make.width.offset(SCREEN_WIDTH / 2);
    }];
    
    [self.lableOfName release];
    
    self.lableOfNum = [[UILabel alloc]init];
    self.lableOfNum.backgroundColor = [UIColor whiteColor];
    [self.contentView addSubview:self.lableOfNum];
    [self.lableOfNum mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerY.equalTo(self.lableOfName.mas_centerY);
        make.leading.equalTo(self.lableOfName.mas_trailing).offset(1);
        make.height.equalTo(self.lableOfName.mas_height);
        make.width.equalTo(self.lableOfName.mas_width);
        
        
    }];
    [self.lableOfNum release];
    
    
    
}

- (void)setModel:(ModelOfUser *)model{

    NSString *str = @"       ";
    
    self.lableOfName.textColor = [UIColor grayColor];
    self.lableOfName.font = [UIFont systemFontOfSize:14];
    self.lableOfNum.textColor = [UIColor grayColor];
    self.lableOfNum.font = [UIFont systemFontOfSize:14];
    self.lableOfName.text = [str stringByAppendingString:model.name];
    self.lableOfNum.text = [str stringByAppendingString: model.num];
    
    
    
}




@end
